<include file="Public:header" />
<!--添加出租房-->
<form id="info_form" action="{:U('Rental/add')}" method="post" enctype="multipart/form-data">
<div class="pad_lr_10">
	<div class="col_tab">
		<ul class="J_tabs tab_but cu_li">
			<li class="current">房源信息</li>
            <li>SEO设置</li>
		</ul>
		<div class="J_panes">
			<div class="content_list pad_10">
				<table width="100%" cellspacing="0" class="table_form">
                    <tr>
                        <th width="120">所属地区 :</th>
                        <td>
                            <select class="J_cate_select mr10" data-pid="0" data-uri="{:U('AreaCate/ajax_getchilds')}" data-selected=""></select>
                            <input type="hidden" name="area_id" id="J_cate_id" value="" />
                        </td>
                    </tr>
                    <tr>
                        <th width="120">所属小区 :</th>
                        <td>
                            <select name="estate_id" id="estate_id">
                                <option value="0">--请选择--</option>
                                <volist name="estate" id="vo">
                                    <option <php>if($vo['id']==$one_estate['id']){</php> selected="selected" <php>}</php>  value="{$vo.id}">{$vo.title}</option>
                                </volist>
                            </select>
                        </td>
                    </tr>

		            <tr>
						<th>房源名称 :</th>
						<td>
							<input type="text" name="title" id="J_title" class="input-text" size="40">
		                </td>
					</tr>
                    <tr>
                        <th>户型 :</th>
                        <td>
                            <select name="room" id="room">
                                <option value="0">-所有-</option>
                                <volist name="menu[24]" id="vo">
                                    <option value="{$vo.parameter}">{$vo.name}</option>
                                </volist>
                            </select><span>室</span>
                            <select name="hall" id="hall">
                                <option value="0">-所有-</option>
                                <volist name="menu[24]" id="vo">
                                    <option value="{$vo.parameter}">{$vo.name}</option>
                                </volist>
                            </select><span>厅</span>
                            <select name="kitchen" id="kitchen">
                                <option value="0">-所有-</option>
                                <volist name="menu[24]" id="vo">
                                    <option value="{$vo.parameter}">{$vo.name}</option>
                                </volist>
                            </select><span>卫</span>
                            <select name="toilet" id="toilet">
                                <option value="0">-所有-</option>
                                <volist name="menu[24]" id="vo">
                                    <option value="{$vo.parameter}">{$vo.name}</option>
                                </volist>
                            </select><span>厨</span>
                            <select name="balcony" id="balcony">
                                <option value="0">-所有-</option>
                                <volist name="menu[24]" id="vo">
                                    <option value="{$vo.parameter}">{$vo.name}</option>
                                </volist>
                            </select><span>阳台</span>
                        </td>
                    </tr>
                    <tr>
                       <th>价格 :</th>
                        <td>月租价 : <input type="text" name="price" id="price" class="input-text" size="8"/><span>元</span>&nbsp;&nbsp;
                            押金: <input type="text" name="deposit" id="deposit" class="input-text" size="8"/><span>元</span>&nbsp;&nbsp;
                            面积 : <input type="text" name="area" id="area" class="input-text" size="8"/><span>平米</span>
                        </td>
                    </tr>
                    <tr>
                        <th>楼层 :</th>
                        <td>&nbsp;&nbsp;&nbsp;&nbsp; 第 :<input type="text" name="floor" class="input-text" size="5"><span>层</span>
                            共<input type="text" name="total_floor" class="input-text" size="5"><span>层</span>
                        </td>
                    </tr>
                    <tr>
                        <th>楼房类型 :</th>
                        <td>{:getLinkMenu(2,'house_type','checkbox')}</td>
                    </tr>
                    <tr>
                        <th>装修情况 :</th>
                        <td>{:getLinkMenu(10,'renovation_type','radio')}</td>
                    </tr>
                    <tr>
                        <th>朝向 :</th>
                        <td>{:getLinkMenu(17,'orientations','radio')}</td>
                    </tr>
                    <tr>
                        <th>房屋配套 :</th>
                        <td>{:getLinkMenu(20,'mating','checkbox')}</td>
                    </tr>
                    <tr>
                        <th>地铁 :</th>
                        <td>{:getLinkMenu(8,'metro','radio')}</td>
                    </tr>
                    <tr>
                        <th>出租方式 :</th>
                        <td>{:getLinkMenu(26,'rental_mode','radio')}</td>
                    </tr>
                    <tr>
                        <th>租房支付方式 :</th>
                        <td>{:getLinkMenu(25,'pay_type','radio')}</td>
                    </tr>
                    <tr>
                        <th>建筑年代 :</th>
                        <td><input type="text" name="years"  size="10" class="input-text"> 年</td>
                    </tr>
                    <tr>
                        <th>特色标签 :</th>
                        <td><textarea name="tags" id="tags" style="width:680px;height:50px;resize: none;"></textarea>多个标签用','号隔开</td>
                    </tr>
                    <tr>
                        <th>所在地址 :</th>
                        <td><input type="text" name="address" id="address" class="input-text" size="60"/> </td>
                    </tr>
                    <tr>
                        <th>地图标注：</th>
                        <td>
                            <input type="text" name="map" id="map" class="input-text" size="27"/>
                            &nbsp;&nbsp;<a href="http://api.map.baidu.com/lbsapi/getpoint/" style="padding: 8px;color:#ffffff;background: #008000" target="_blank">获取百度地图坐标</a>
                        </td>
                    </tr>
                    <tr>
                        <th>缩略图:</th>
                        <td><input type="file" name="img" id="img" class="input-text"  style="width:200px;" /></td>
                    </tr>
                    <tr>
                        <th>房源图片 :</th>
                        <td><script id="uploadpic" name="uploadpic" type="text/plain"></script>
                            <input type="button" class="btn btn_submit" style="margin:0 0 10px 10px;" onclick="upImage();" value="选择图片">
                            <div id="imageList">
                                <ul class="list clearfix">
                                </ul>
                            </div>
                            <input type="hidden" name="file" id="file" />
                        </td>
                    </tr>
                    <tr>
                        <th>房源介绍 :</th>
                        <td><textarea name="info" id="info"></textarea></td>
                    </tr>
                    <tr>
                        <th>联系人 :</th>
                        <td><input type="text" name="contacts" id="contacts" class="input-text" size="25"/> </td>
                    </tr>
                    <tr>
                        <th>联系电话 :</th>
                        <td><input type="text" name="phone" id="phone" class="input-text" size="30"/> </td>
                    </tr>
                    <tr>
                        <th>发布 :</th>
                        <td>
                            <select name="status" id="status">
                                <volist name="status" id="vo">
                                    <option value="{$key}">{$vo}</option>
                                </volist>
                            </select>
                        </td>
                    </tr>
                    <tr>
                        <th>相关推荐</th>
                        <td>
                            是否推荐:
                            <label><input type="radio" name="is_rec" class="radio_style" value="1"> {:L('yes')} </label>&nbsp;
                            <label><input type="radio" name="is_rec" class="radio_style" value="0" checked="checked" > {:L('no')}</label>
                            &nbsp;&nbsp;
                            急租房源:
                            <label><input type="radio" name="is_emergency" class="radio_style" value="1"> {:L('yes')} </label>&nbsp;
                            <label><input type="radio" name="is_emergency" class="radio_style" value="0"  checked="checked"> {:L('no')}</label>
                            &nbsp;&nbsp;
                            房源来源:
                            <label><input type="radio" name="source" class="radio_style" value="1" checked="checked">个人</label>&nbsp;
                            <label><input type="radio" name="source" class="radio_style" value="2"  >中介/公司</label>
                        </td>
                    </tr>

				</table>
			</div>
            <div class="content_list pad_10 hidden">
                <table width="100%" cellspacing="0" class="table_form">
                    <tr>
                        <th width="120">{:L('seo_title')} :</th>
                        <td><input type="text" name="seo_title" id="seo_title" class="input-text" size="60"></td>
                    </tr>
                    <tr>
                        <th>{:L('seo_keys')} :</th>
                        <td><input type="text" name="seo_keys" id="seo_keys" class="input-text" size="60"></td>
                    </tr>
                    <tr>
                        <th>{:L('seo_desc')} :</th>
                        <td><textarea name="seo_desc" id="seo_desc" cols="80" rows="8"></textarea></td>
                    </tr>
                </table>
            </div>

            </div>
		<div class="mt10"><input type="submit" value="{:L('submit')}" id="dosubmit" name="dosubmit" class="btn btn_submit" style="margin:0 0 10px 100px;"><br /><br /><br /></div>
	</div>
</div>
</form>
<include file="Public:footer" />
<js file="__STATIC__/ueditor/ueditor.config.js" charset="utf-8" />
<js file="__STATIC__/ueditor/ueditor.all.min.js" charset="utf-8" />
<js file="__STATIC__/ueditor/lang/zh-cn/zh-cn.js" charset="utf-8" />
<script type="text/javascript">
    window.UEDITOR_HOME_URL='__STATIC__/ueditor/';
    window.onload=function(){
        upmoreimg();
        window.UEDITOR_CONFIG.initialFrameWidth=880;
        window.UEDITOR_CONFIG.initialFrameHeight=500;
        UE.getEditor('info',{autoFloatEnabled:false});
    }
</script>
<script type="text/javascript">
    var check_name_url = "{:U('Rental/ajaxCheckTitle')}";
    $(function(){
        $('ul.J_tabs').tabs('div.J_panes > div');
        $('.J_cate_select').cate_select('请选择');
        $.formValidator.initConfig({formid:"info_form",autotip:true});
        $("#J_title").formValidator({onshow:"请填写房源名称",onfocus:"请填写房源名称"}).inputValidator({min:1,onerror:"请填写房源名称"}).ajaxValidator({
            type : "get",
            url : check_name_url,
            datatype : "json",
            async:'false',
            success : function(result){
                if(result.status == 0){
                    return false;
                }else{
                    return true;
                }
            },
            buttons: $("#dosubmit"),
            onerror : "请填写房源名称",
            onwait : "正在验证"
        });
        $(":radio[name^='renovation_type']").formValidator({onshow:"请选择装修情况",onfocus:"请选择装修情况"}).inputValidator({min:1,max:10,onerror:"请选择装修情况"});
    });
</script>
<js file="__JS__/uploadImg.js" charset="utf-8" />
</body>
</html>